<?

# Include-File für Wetterdaten der Uni Münster

include_once("download.inc.php");

$string = download("www.uni-muenster.de","/Klima/forschung/stadtklima.shtml");
$html = str_get_html($string);
$item = array();

$i=0;
// Finde die Wetter-Tabelle und alle Spalten
foreach($html->find('table.news_weather') as $article) {
	foreach($article->find('td') as $article2) {

	$i++;
    $item[$i]   = $article2->plaintext;
	}
}

//Fehlerbehandlung
$time_data = strtotime($item[1]);
$time_now = strtotime(date('Y-m-d H:i'));
$diff = $time_now - $time_data;
if ($diff > 3600) {
    $error = true;
} else {
    $error = false;
}
$unimuensterdaten = str_replace(",",".",substr($item[2],0,-7)) . "&deg;C<br />" . preg_replace('/[^a-z ]/i', '',html_entity_decode(substr($item[8],3,-1)));

?>